#include<stdio.h>

#include"sgxiao_util.h"

/**
 * stirling[] triangle generator
 */

/* 2010-04-20 */
static unsigned long long  perm[SGXIAO_UTIL_VECTOR_MAX][SGXIAO_UTIL_VECTOR_MAX];
int main(void)
{
	int i;
	int N;
	int n, k;
	
	scanf("%d", &N);
	if(N > SGXIAO_UTIL_VECTOR_MAX)
		N = SGXIAO_UTIL_VECTOR_MAX;
	
	perm[0][0] = 1;

	for(i=1; i<=103; i++) {
		perm[i][1] = 1;
		perm[i][i] = 1;
	}

	for(n=1; n<=103; n++) {
		for(k=1; k<n; k++) {
			perm[n][k] = (n-1) * perm[n-1][k] + perm[n-1][k-1];
		}
	}

	sgxiao_util_print_triangle(perm, N);
	return 0;
}

/*
void print_vector(int height, int weight)
{
	int i, j;
	for(i=0; i<height; i++) {
		for(j=0; i<weight; j++) {
			printf("%llu ", perm[i][j]);
		}
		putchar('\n');
	}
}

void print_triangle(int height)
{
	int i, j;
	for(i=0; i<height; i++) {
		for(j=0; j<=i; j++) 
			printf("%llu ", perm[i][j]);	
		putchar('\n');
	}
}
*/
